// pages/me/me.ts
import { H2oLifeTool } from '../../utils/bo';
import {dao} from '../../utils/repository';
Component({
  options: {styleIsolation: 'apply-shared'},
  data: {
    motto: '欢迎',
    avatarUrl:"",
    nickName:"",
    lifeCards:Array<H2oLifeTool>(),
  },
  lifetimes:{
    created:function(){},
    attached: function () { 
      const usr = dao.getUser()
      if(usr !== undefined){
        this.setData({avatarUrl: usr.avatar,nickName: usr.name, lifeCards:dao.getGoodTools()})
      }else{
        this.setData({lifeCards:dao.getGoodTools()})
      }
    }
  },
  methods:{
    onDoAction(_e:any){
    }
  }
})